using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.ComponentModel;

namespace Mdv.wssAddins.wss
{
    public class wssViews : Model
    {
        #region Non-Designer Properties
        private List<wssView> _views;
        [Browsable(false)]
        public List<wssView> Views
        {
            get { return _views; }
        }
        #endregion
        public override string ToString()
        {
            return "Views";
        }
        public override void ConstructMap()
        {
        }
        public override void LoadChildren(XmlNode node)
        {
            foreach (XmlNode xn in node.ChildNodes)
            {
                switch (xn.Name)
                {
                    case "View":
                        wssView view = new wssView();
                        view.Load(xn);
                        Children.Add(view);
                        break;
                }
            }
        }
        public wssViews()
        {
            Actions = new List<Action>();
            Actions.Add(new Action("Add View", this.AddView));
            Actions.Add(new Action("Delete", this.Delete));
        }
        public void AddView(ModelEventArgs e)
        {
            NodeAdded(new wssView(), "View");
        }
        public void Delete(ModelEventArgs e)
        {
            NodeDeleted("Views");
        }
    }
}